package com.example.chapter13;


import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/*
 * 13.3.案例实施-删除文件
 * */
public class FileDeleteExample {
    public static void main(String[] args) {
        String filePath = "path/to/your/file.txt";
        Path path = Paths.get(filePath);
        try {
            Files.delete(path);
            System.out.println("File deleted successfully");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
